<template>
  <div>
    <div class="header">
      <div class="header-box">
        <div class="header-l">
          <van-icon name="arrow-left" />
          <span @click="backTo">返回</span>
        </div>
        <h2 class="header-m" >我的收藏</h2>
        <div></div>
      </div>
    </div>

    <!-- 商品展示 -->
    <div class="footer-goods" v-if="list">
      <ul class="newGoodList">
          <li
            class="newGoodList-item"
            v-for="el in list"
            :key="el.id"
            @click="toGoodsDetail(el.id)"
          >
            <img class="img" :src="el.list_pic_url" alt="" />
            <div class="goods-txt">
              <span class="txt-t">{{el.goods_brief }}</span>
              <span class="txt-b">{{el.retail_price }}</span>
            </div>
          </li>
         <li></li>
        </ul>
    </div>

  </div>
</template>

<script>
import { listAction } from "@/api/user"


export default {
  name: "",
  data() {
    return {
        list:[]
    };
  },
  created() {
    listAction({
        openId:localStorage.getItem('openId')
    }).then(res=>{
        this.list=res.collectGoodsList
        console.log(res,this.list);

    })
  },
  mounted() {},
  methods: {
    toGoodsDetail(id){
      this.$router.push({ path: "/home/goodsDetail", query: { id: id } });

    },
    backTo(){
        this.$router.back()
    }
  },
};
</script>

<style lang="scss" scoped>
@import './scss/index.scss'
</style>>